Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert Suspense cache Thenable.catch() change #22280

Merged
merged 8 commits into from
Sep 9, 2021

Conversation

bvaughn
Copy link
Contributor

@bvaughn bvaughn commented Sep 9, 2021

Stacks on top of PR #22263 to avoid causing merge conflicts in hookNamesCache.js.

Compare the two branches only

Reverts part of #22275 (adding .catch() to Thenables in Suspense caches) in response to #22275 (comment).

After taking another look with fresh eyes, I think I see the "uncaught error" issue I initially noticed was here:

inspectElementMutableSource({
bridge,
element,
path: null,
rendererID: ((rendererID: any): number),
}).then(
([
inspectedElement: InspectedElementFrontend,
responseType: InspectedElementResponseType,
]) => {
if (responseType === 'full-data') {
startTransition(() => {
const [key, value] = createCacheSeed(element, inspectedElement);
refresh(key, value);
});
}
},
);

Brian Vaughn added 8 commits September 9, 2021 14:16
And used it to import named hooks code.

Note this commit currently breaks the test shell.
And changed dynamic import() code to be passed in rather than embedded in the package
Ideally we can remove this param once the Webpack 5 upgrade has finished.
Fixed the actual case of error which was in InspectedElementCache checkForUpdate().
@facebook-github-bot facebook-github-bot added CLA Signed React Core Team Opened by a member of the React Core Team labels Sep 9, 2021
@bvaughn bvaughn changed the title Added named hooks feature flag to DevToolsFeatureFlags Revert Suspense cache Thenable.catch() change Sep 9, 2021
Copy link
Contributor

@jstejada jstejada left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for following up on this, and submitting as a separate PR!

not a big deal, but since the original commit landed against main, wouldn't it be easier to land this revert on main directly, instead of stacking on top #22263? it seems like #22263 only has a simple change on hookNamesCache.js, so i wouldn't expect it to produce any significant merge conflicts, but idk.

in any case, not a big deal, up to you

regarding the changes themselves, so if inspecting the element fails, we don't really show anything in the UI? what does that look like currently?

After taking another look with fresh eyes, I think I see the "uncaught error" issue I initially noticed was here:

did you verify if the case you were seeing before shows up now reported as a console.error after these changes?

@bvaughn
Copy link
Contributor Author

bvaughn commented Sep 9, 2021

not a big deal, but since the original commit landed against main, wouldn't it be easier to land this revert on main directly, instead of stacking on top #22263? it seems like #22263 only has a simple change on hookNamesCache.js, so i wouldn't expect it to produce any significant merge conflicts, but idk.

I can land #22263 first then this PR so they are separate.

regarding the changes themselves, so if inspecting the element fails, we don't really show anything in the UI? what does that look like currently?

It will show a red icon with a tooltip that the parsing failed.

did you verify if the case you were seeing before shows up now reported as a console.error after these changes?

Yup! At least it seemed to.

If we see another case where it's not handled, let's dig in and figure out how to fix it too 😄

@bvaughn bvaughn merged commit 96814e7 into facebook:main Sep 9, 2021
@bvaughn bvaughn deleted the devtools-suspense-cache-follow-up branch September 9, 2021 19:26
zhengjitf pushed a commit to zhengjitf/react that referenced this pull request Apr 15, 2022
Reverts part of facebook#22275 (adding .catch() to Thenables in Suspense caches) in response to facebook#22275 (comment).

After taking another look with fresh eyes, I think I see the "uncaught error" issue I initially noticed was in checkForUpdate() (which did not pass an error handler to .then)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed React Core Team Opened by a member of the React Core Team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants